package utfpr.gang5.hermes.controledepresenca.cliente;

import java.rmi.Naming;

import utfpr.gang5.hermes.controledepresenca.pojo.Professor;
import utfpr.gang5.hermes.controledepresenca.rmi.ControlePresencaService;
import utfpr.gang5.hermes.controledepresenca.rmi.Status;

public class ClienteRmi {
	public static void main(String[] args) {
		 try {  
			  ControlePresencaService s = (ControlePresencaService) Naming.lookup( "rmi://localhost/ControlePresencaService" );
			  
			  
			  Professor professor = new Professor();
			  professor.setNome("Juliano Almeida");
			  professor.setUsername("juli");
			  professor.setSenha("1sfs");
			  
			  Status status = s.salvarProfessor(professor);
			  
			  System.out.println(status.isSucesso());
			  System.out.println(status.getMensagemErro());
	        }  
	        catch( Exception e ) {  
	            System.out.println();  
	            System.out.println( "MalformedURLException: " + e.toString() );  
	        }  
	       
	}
}
